﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AreaManage_Bottom.aspx.cs" Inherits="BaseData_AreaManage_Bottom" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
 <title>组织树</title>
    <link rel="stylesheet" href="../css/css.css" type="text/css" />
    <script language="javascript" type="text/javascript">
     var stype;
     function btnMageClk(type)
     {//debugger;
        stype = type;
        var sobj = parent.CenterFrame.hidform.hOrgInfo.value ;
        var sPCIDCOl = parent.CenterFrame.hidform.hParentChildIDCol.value ;  //当前结点的直系上下级包括自己的ID集合
        OrgForm.Hcode.value = sobj;
        var ary = sobj.split('|');
        var sFeatures = "dialogHeight:400px;dialogWidth:600px;resizeable:no;help:no;status:no";
        //type:1-增加；2-修改；3-删除；4-查看；5-显示删除；6-隐藏删除；7-导出；8-恢复已经删除的数据
        switch (type)
        { 
             case 1://增加             
                    if(""==sobj)
                    {
                        alert("没有选择组织名称时,默认创建顶级组织");
                    }
                    showModalDialog("AreaManage_Edit.aspx?type=1&ParentChildID="+ary[0],window,sFeatures);
                    //刷新GridView
				    var btnRefresh=parent.CenterFrame.document.getElementById("BtnRefresh1");
				    if(btnRefresh!=null)
				       btnRefresh.click();
                    break;
             case 2://修改
                    if(""==sobj)
                    {
                        alert("请选择要修改的组织名称");
                        return;
                    }      
                    showModalDialog("AreaManage_Edit.aspx?type=2&ParentChildID="+sPCIDCOl,window,sFeatures);
                    //刷新GridView
				    var btnRefresh=parent.CenterFrame.document.getElementById("BtnRefresh2");
				    if(btnRefresh!=null)
				        btnRefresh.click();				    
                    break;
            case 3: //删除
                    if(""==sobj)
                    {
                        alert("请选择要删除的组织名称");
                        return;
                    }             
                    if(confirm("真的要删除该条记录？"))
                    {
				        var ifrmDel=parent.CenterFrame.document.getElementById("BtnDel");
				        if(ifrmDel!=null)
				        {
				          ifrmDel.click();				         
				        }
                    }
                    else
                    {
                        var btnRefresh=parent.CenterFrame.document.getElementById("BtnRefresh2");
				        if(btnRefresh!=null)
				            btnRefresh.click();	
                    }
                    break;
         }
     }
    </script>
</head>
<body style =" background-image :url('../images/hit_bg.gif');">
    <form id="OrgForm" runat="server">
    <table align="center" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style ="width:30%;"></td>
          <td align ="center" >
              <input name="btn_new_pd"  id="btn_new_pd" type="button" class="button03" onclick="btnMageClk(1)" value="增加(A)" accesskey ="a"/>
              <input name="btn_hf_view"  id="btn_hf_view" type="button" class="button03"  onclick= "btnMageClk(2)" value="修改(E)" accesskey ="e" />
              <input name="btn_hf_del" id="btn_hf_del" type="button" class="button03"  onclick= "btnMageClk(3)"    value="删除(D)" accesskey ="d"  />
          </td> 
        </tr>
      </table>
        <input id="Hcode" type="hidden" />
        <input type="hidden" id="hID" runat ="server"  />
        <input type="hidden" id="hName" runat ="server"  />
        <input type="hidden" id="hParentID" runat ="server" />
        <input type="hidden" id="hChildNumber" runat ="server" />
        <input type="hidden" id="hDOrder" runat ="server" />
        <input type="hidden" id="hEffective" runat ="server" />
        <input type="hidden" id="hParentName" runat ="server" />
    </form>
</body>
</html>
